/*
 * @Description: 
 * @Autor: wanghuan
 * @Date: 2021-12-09 15:06:38
 * @LastEditors: wanghuan
 * @LastEditTime: 2021-12-10 13:44:26
 */

import Vue from "vue";
import VClamp from 'vue-clamp'
import lineClamp from 'vue-line-clamp'
Vue.component("v-clamp" , VClamp);
// 添加指令
Vue.use(lineClamp)
// 使用示例 对于富文本 二次处理
// <v-clamp autoresize :max-lines="3">{{ text }}</v-clamp>
// <v-clamp autoresize :max-lines="3">{{ $_getSimpleText( html ) }}</v-clamp>
//html剔除富文本标签，留下纯文本
function getSimpleText(html) {
    var re1 = new RegExp("<.+?>", "g"); //匹配html标签的正则表达式，"g"是搜索匹配多个符合的内容
    var msg = html.replace(re1, ''); //执行替换成空字符
    return msg;
}
Vue.prototype.$_getSimpleText = getSimpleText;